﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using Microsoft.SharePoint.Utilities;

namespace UE.SharePoint.ImportExport.Resources
{
    public class ImportExportResource
    {
        private static readonly string ResourceFormat = "$Resources:{0}";
        private static string fileName = "UE.SharePoint.ImportExport";
        
        /// <summary>
        /// 
        /// </summary>
        private static uint CID
        {
            get
            {
                return (uint)CultureInfo.CurrentUICulture.LCID;
            }
        }

        public static string UploadPage_Title
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.Title", ImportExportResource.CID);
            }
        }

        public static string UploadPage_Description
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.Description", ImportExportResource.CID);
            }
        }

        public static string UploadPage_Cancel
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.Cancel", ImportExportResource.CID);
            }
        }

        public static string UploadPage_NameTitle
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.NameTitle", ImportExportResource.CID);
            }
        }

        public static string UploadPage_NameDescription
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.NameDescription", ImportExportResource.CID);
            }
        }
        
        public static string UploadPage_Name
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.Name", ImportExportResource.CID);
            }
        }
        
        public static string ImportErrorFormat
        {
            get
            {
                return ImportExportResource.GetText("ImportErrorFormat", ImportExportResource.CID);
            }
        }
        public static string ImportResultFormat
        {
            get
            {
                return ImportExportResource.GetText("ImportResultFormat", ImportExportResource.CID);
            }
        }

        public static string UploadPage_Ok
        {
            get
            {
                return ImportExportResource.GetText("UploadPage.Ok", ImportExportResource.CID);
            }
        }

        public static string ExportSchemaPage_Title
        {
            get
            {
                return ImportExportResource.GetText("ExportSchemaPage.Title", ImportExportResource.CID);
            }
        }

        public static string ExportSchemaPage_Description
        {
            get
            {
                return ImportExportResource.GetText("ExportSchemaPage.Description", ImportExportResource.CID);
            }
        }  

        public static string ExportSchemaPage_FormatLabel
        {
            get
            {
                return ImportExportResource.GetText("ExportSchemaPage.FormatLabel", ImportExportResource.CID);
            }
        }

        public static string ExportSchemaPage_NameLabel
        {
            get
            {
                return ImportExportResource.GetText("ExportSchemaPage.NameLabel", ImportExportResource.CID);
            }
        }

        public static string ExportSchemaPage_ContainAdditionalColumnsLabel
        {
            get
            {
                return ImportExportResource.GetText("ExportSchemaPage.ContainAdditionalColumnsLabel", ImportExportResource.CID);
            }
        }

        public static string ExportPage_Title
        {
            get
            {
                return ImportExportResource.GetText("ExportPage.Title", ImportExportResource.CID);
            }
        }

        public static string ExportPage_Description
        {
            get
            {
                return ImportExportResource.GetText("ExportPage.Description", ImportExportResource.CID);
            }
        }

        public static string ExportPage_FormatLabel
        {
            get
            {
                return ImportExportResource.GetText("ExportPage.FormatLabel", ImportExportResource.CID);
            }
        }

        public static string ExportPage_NameLabel
        {
            get
            {
                return ImportExportResource.GetText("ExportPage.NameLabel", ImportExportResource.CID);
            }
        } 

        /// <summary>
        /// 
        /// </summary>
        /// <param name="resourceKey"></param>
        /// <param name="cid"></param>
        /// <returns></returns>
        public static string GetText(string resourceKey, uint cid)
        { 
            string source = string.Format(ImportExportResource.ResourceFormat, resourceKey);
            return SPUtility.GetLocalizedString(source, ImportExportResource.fileName, cid);
        } 
    }
}
